package indi.walty.dl8888_dirver;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class Config {
	public static final int FRAME_WIDTH = 640;
	public static final int FRAME_HEIGHT = 70;
	public static final double IMG_THRESH = 127;
	public static final double IMG_MAXVAL = 1;
	public static final int PAPER_WIDTH = 480;
	public static final int PAPER_HEIGHT = 320;
	public static final String BITMAT_MODE = "0";
	public static final byte[] PRN_LEARN = {0x5a,0x5a,0x5a,0x4c,0x45,0x41,0x52,0x4e,0x0d,0x0a};
	public static final String TSPL = "SIZE 60 mm,40 mm\n" + 
										"CLS\n" + 
										"BITMAP ##WALTY_BYTES##\n" + 
										"PRINT 1,1\n";
	public static final String BYTES_PLACEHOLDER = "##WALTY_BYTES##";
	public static String ABSOLUTE_PATH;
	public static String PRN_PATH;
	public static String JNI_PATH;
	static {
		Properties properties = new Properties();
		try {
			InputStream is = new FileInputStream(new File("config/config.properties"));
			properties.load(is);
			ABSOLUTE_PATH = properties.getProperty("ABSOLUTE_PATH","/usr/include/");
			PRN_PATH = ABSOLUTE_PATH+"c/tspl.prn";
			JNI_PATH = ABSOLUTE_PATH+"c/libDL888.so";
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			//e.printStackTrace();
			System.out.println("Can't find config.properties");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 
	}
	//public static final String 
}
